package com.ruoyi.report.controller.report;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.report.domain.*;
import com.ruoyi.report.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: 憨憨爱崽崽
 * Name: HanZaiTheInformationOfTheServiceController 客户信息报表
 * Date: 2022/4/9
 * Time: 16:02
 **/
@RestController
@RequestMapping("/the_information_of_the_service")
public class HanZaiTheInformationOfTheServiceController extends BaseController {
    @Autowired
    private HanZaiTheInformationOfTheServiceService service;
    @Autowired
    private HanZaiCityService cityService;
    @Autowired
    private HanZaiCuStsTateService cuStsTateService;
    @Autowired
    private HanZaiSaleActiveService activeService;
    @Autowired
    private HanZaiEmailService emailService;
    @GetMapping("/information/list")
    public TableDataInfo getInformationList(HanZaiTheInformationOfTheService theInformationOfTheService){
        startPage();
        List<HanZaiTheInformationOfTheService> theServiceList = service.selectTheInformationOfTheServiceList(theInformationOfTheService);
        //for (HanZaiTheInformationOfTheService ofTheService : theServiceList){
        //    HanZaiCity cityNation = cityService.selectCityById(ofTheService.getNation());
        //    HanZaiCity cityBaby = cityService.selectCityById(ofTheService.getBabyaddr());
        //    HanZaiCuStsTate cuStsTate = cuStsTateService.selectStsTateByCuStsTateId(Integer.valueOf(ofTheService.getCuststate()));
        //    HanZaiSaleActive saleActive = activeService.selectSaleActiveById(Integer.valueOf(ofTheService.getActiveid()));
        //    String userName = emailService.selectUserName(Integer.valueOf(ofTheService.getSaleperson()));
        //    ofTheService.setNationName(cityNation.getCityName());
        //    ofTheService.setBabyName(cityBaby.getCityName());
        //    ofTheService.setCustStateName(cuStsTate.getCuStStateName());
        //    ofTheService.setActiveName(saleActive.getActiveName());
        //    ofTheService.setSalepersonName(userName);
        //}
        System.out.println(theServiceList);
        return getDataTable(theServiceList);
    }
}
